﻿using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using ReflectionStudio.Core.Events;
namespace WPFExcelReport
{
    /// <summary>
    /// Interaction logic for ProductionOrder.xaml
    /// </summary>
    public partial class UILIEFKO : ViewBase
    {
        public VLIEFKO TMV
        {
            get
            {
                return (VLIEFKO)MV;
            }
        }        
        #region ==LIEFNR===========
        public static readonly DependencyProperty LIEFNRProperty = DependencyProperty.Register("LIEFNR",
            typeof(string), typeof(UILIEFKO),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnLIEFNRChanged));
        public string LIEFNR
        {
            get
            {
                return (string)GetValue(LIEFNRProperty);
            }
            set
            {
                SetValue(LIEFNRProperty, value);
                OnLIEFNRChg(value);
            }
        }
        private static void OnLIEFNRChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UILIEFKO;
            if (src != null)
            {
                src.LIEFNR = (string)e.NewValue;
            }
        }
        #endregion

        #region ==SART===========
        public static readonly DependencyProperty SARTProperty = DependencyProperty.Register("SART",
            typeof(string), typeof(UILIEFKO),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSARTChanged));
        public string SART
        {
            get
            {
                return (string)GetValue(SARTProperty);
            }
            set
            {
                SetValue(SARTProperty, value);
                if (MV == null) return;
                if (IsEdit && dwMaster != null)
                {
                    ((VLIEFKO)MV).LSKVERSART = value;
                }
            }
        }
        private static void OnSARTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UILIEFKO;
            if (src != null)
            {
                src.SART = (string)e.NewValue;
            }
        }
        #endregion

        #region ==VSPED===========
        public static readonly DependencyProperty VSPEDProperty = DependencyProperty.Register("VSPED",
            typeof(string), typeof(UILIEFKO),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVSPEDChanged));
        public string VSPED
        {
            get
            {
                return (string)GetValue(VSPEDProperty);
            }
            set
            {
                SetValue(VSPEDProperty, value);
                if (MV == null) return;
                if (IsEdit && dwMaster != null)
                {
                    ((VLIEFKO)MV).LSKSPEDSL = value;
                }
            }
        }
        private static void OnVSPEDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UILIEFKO;
            if (src != null)
            {
                src.VSPED = (string)e.NewValue;
            }
        }
        #endregion

        #region ==LIEFBED===========
        public static readonly DependencyProperty LIEFBEDProperty = DependencyProperty.Register("LIEFBED",
            typeof(string), typeof(UILIEFKO),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnLIEFBEDChanged));
        public string LIEFBED
        {
            get
            {
                return (string)GetValue(LIEFBEDProperty);
            }
            set
            {
                SetValue(LIEFBEDProperty, value);
                if (MV == null) return;
                if (IsEdit && dwMaster != null)
                {
                    ((VLIEFKO)MV).LSKLIEFBED = value;
                }
            }
        }
        private static void OnLIEFBEDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UILIEFKO;
            if (src != null)
            {
                src.LIEFBED = (string)e.NewValue;
            }
        }
        #endregion

        #region ==ZAHLBED===========
        public static readonly DependencyProperty ZAHLBEDProperty = DependencyProperty.Register("ZAHLBED",
            typeof(string), typeof(UILIEFKO),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnZAHLBEDChanged));
        public string ZAHLBED
        {
            get
            {
                return (string)GetValue(ZAHLBEDProperty);
            }
            set
            {
                SetValue(ZAHLBEDProperty, value);
                if (MV == null) return;
                if (IsEdit && dwMaster != null)
                {
                    ((VLIEFKO)MV).LSKZAHLBED = value;
                }
            }
        }
        private static void OnZAHLBEDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UILIEFKO;
            if (src != null)
            {
                src.ZAHLBED = (string)e.NewValue;
            }
        }
        #endregion

        public UILIEFKO()
        {
        }

       

        public virtual void OnLIEFNRChg(string value)
        {

        }

    }
}
